﻿@*doing excerpt generation on the way out for now so we don't stick ourselves with needing to regen excerpts for existing data
  also, doing this here, inline, until we have a pluggable processing model (both in and out)
  also, ...this is ugly *@
@model dynamic

@using Orchard.Fields.Fields;
@using Orchard.Core.Common.Models;
@using Orchard.Core.Title.Models;
@using Contrib.BSCarouselSlide.Models;
@using Orchard.ContentManagement;

@{
    var theModel = ((IContent)Model.ContentPart).As<BSCarouselSlidePart>();
    var theTitle = ((IContent)Model.ContentPart).As<TitlePart>();
    
    var theBody = ((IContent)Model.ContentPart).As<BodyPart>();
    string bodyHtml = theBody.Text.ToString();
    var body = new HtmlString(Html.Excerpt(bodyHtml, 200).ToString().Replace(Environment.NewLine, "</p>" + Environment.NewLine + "<p>")); 

    }
 <p class="numeric-field numeric-field-priority">
        <span class="name">@T("Priority"):</span>
        <span class="value">@theModel.Priority</span>
 </p>
 <p class="numeric-field numeric-field-hastext">
        <span class="name">@T("HasText"):</span>
        <span class="value">@theModel.HasText</span>
        <span class="value">[@theModel.TextClass]</span>
 </p>
 <p class="numeric-field numeric-field-hasimage">
        <span class="name">@T("HasImage"):</span>
        <span class="value">@theModel.HasImage</span>
        <span class="value">[@theModel.ImageClass]</span>
 </p>
<p>@body @Html.ItemDisplayLink(T("more").ToString(), (ContentItem)Model.ContentPart.ContentItem)</p>